﻿/*--打开Div--*/
/*参数说明：id是div的ID、divWidth是弹出层的宽度、divHeight是弹出层的高度*/
function showbak(id,divWidth,divHeight)
{
	var divId=document.getElementById(id);
	divId.style.left=(document.body.clientWidth-divId.clientWidth)/2+document.body.scrollLeft-150;
	divId.style.top=(document.body.clientHeight-divId.clientHeight)/2+document.body.scrollTop-50;
    divId.style.display="";
} 
function show(ids,divWidth,divHeight)
{

	
    var count=document.getElementsByTagName("div");
    for(var i=0;i<count.length;i++)
    {
       var id=count[i].id;
       var stids=""+ids+"";
       var stid=""+id+"";

       if(stids==stid)
       {
		    var divId=document.getElementById(ids);
			var x_Px_page = pointerX(); 
            var y_Px_page = pointerY();
			divId.style.left=x_Px_page;//(document.body.clientWidth-divId.clientWidth)/2+document.body.scrollLeft-150;
			divId.style.top=y_Px_page;//(document.body.clientHeight-divId.clientHeight)/2+document.body.scrollTop-100;
		    divId.style.display="";       
       }
       else
       {
           var ind=stid.indexOf("fd");
           if(ind!=-1)
           {
                var divId=document.getElementById(id);
                var disp=""+divId.style.display+"";
                if(disp!="none")
                {
                    divId.style.display="none";
                }
           }
       }
    }
}
function tests(o,ids,divWidth,divHeight)
{

	
    var count=document.getElementsByTagName("div");
    for(var i=0;i<count.length;i++)
    {
       var id=count[i].id;
       var stids=""+ids+"";
       var stid=""+id+"";

       if(stids==stid)
       {
		    var divId=document.getElementById(ids);
			var x_Px_page = pointerX(); 
            var y_Px_page = pointerY();
			divId.style.left=x_Px_page;//(document.body.clientWidth-divId.clientWidth)/2+document.body.scrollLeft-150;
			divId.style.top=y_Px_page;//(document.body.clientHeight-divId.clientHeight)/2+document.body.scrollTop-100;
		    divId.style.display="";       
       }
       else
       {
           var ind=stid.indexOf("fd");
           if(ind!=-1)
           {
                var divId=document.getElementById(id);
                var disp=""+divId.style.display+"";
                if(disp!="none")
                {
                    divId.style.display="none";
                }
           }
       }
    }

} 
/*--关闭Div--*/
function closeed(id)
{
	var divId=document.getElementById(id);
    divId.style.display="none";      
}  
function pointerX()  
{    
   return event.pageX || (event.clientX +     (document.documentElement.scrollLeft || document.body.scrollLeft));  
} 
 
function pointerY() 
{    
    return event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop));  
}
function getPointPosition() 
{ 
    var x_px_scr = event.clientX;  
    var y_px_scr = event.clientY; 
    //alert("相对于当前屏幕的X轴偏移量" + x_px_scr); 
   // alert("相对于当前屏幕的Y轴偏移量" + y_px_scr); 

    var x_Px_page = pointerX(); 
    var y_Px_page = pointerY(); 
    //alert("相对于整个页面的X轴偏移量" + x_Px_page); 
    //alert("相对于整个页面的Y轴偏移量" + y_Px_page); 
} 
